package com.lcq.study.collection;

import java.util.PriorityQueue;

/**
 * @ClassName QueueTest
 * @Description
 * @Author lichuanqi
 * @Date 2022/5/27 10:37
 * @Version 1.0
 **/
public class QueueTest {
    public static void main(String[] args) {
        priorityQueue();
    }

    private static void priorityQueue() {
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        queue.offer(99);
        queue.offer(33);
        queue.offer(55);
        queue.offer(44);
        queue.offer(77);
        while (queue.size()!=0){
            System.out.println(queue.poll());
        }
    }

    private static void arrayQueue() {
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        queue.offer(99);
        queue.offer(33);
        queue.offer(55);
        queue.offer(44);
        queue.offer(77);
        while (queue.size() != 0){
            System.out.println(queue.poll());
        }
    }
}
